Video signal processing method and device

ABSTRACT

A method for processing a vide signal, according to the present invention comprises generating a reference picture list based on a current picture reference flag for a current picture, obtaining motion information about a current block in the current picture, and restoring the current block using the motion information of the current block and the reference picture list relating to the current picture.

TECHNICAL FIELD

The present invention relates to a method and an apparatus forprocessing a video signal.

BACKGROUND ART

Demands for high-resolution, high-quality images such as High Definition(HD) images and Ultra High Definition (UHD) images have recentlyincreased in various fields of applications. As video data has a higherresolution and higher quality, the video data is larger in amount thantraditional video data. Therefore, if video data is transmitted on anexisting medium such as a wired/wireless wideband circuit or stored inan existing storage medium, transmission cost and storage cost increase.To avert these problems encountered with higher-resolution,higher-quality video data, high-efficiency video compression techniquesmay be used.

There are a variety of video compression techniques includinginter-picture prediction in which pixel values included in a currentpicture are predicted from a picture previous to or following thecurrent picture, intra-picture prediction in which pixel values includedin a current picture are predicted using pixel information in thecurrent picture, and entropy encoding in which a short code is assignedto a more frequent value and a long code is assigned to a less frequentvalue. Video data may be compressed effectively and transmitted orstored, using such a video compression technique.

Along with the increasing demands for high-resolution videos, demandsfor three-dimensional (3D) video content as a new video service havebeen increasing. A video compression technique for effectively providingHD and UHD 3D video content is under discussion.

DISCLOSURE Technical Problem

An object of the present invention is to provide a method and apparatusfor predicting or restoring based on a current picture reference mode inencoding/decoding a video signal.

An object of the present invention is to provide a method and apparatusfor deriving a block vector used in a current picture reference mode inencoding/decoding a video signal.

An object of the present invention is to provide a method and apparatusfor generating a reference picture list for a current picture referencemode in encoding/decoding a video signal.

Technical Solution

A video signal decoding method and apparatus according to the presentinvention includes: generating a reference picture list based on acurrent picture reference flag for a current picture; obtaining motioninformation about the current block in the current picture; andrestoring the current block using the motion information of the currentblock and the reference picture list.

In the method and apparatus for decoding a video signal according to thepresent invention, the current picture reference flag indicates whetherat least one block belonging to a video sequence or a picture uses acurrent picture reference mode.

In the method and apparatus for decoding a video signal according to thepresent invention, the current picture reference mode refers to a methodof predicting or restoring the current block by referring to apre-reconstructed block in the current picture.

In the method and apparatus for decoding a video signal according to thepresent invention, the current picture is added to the reference picturelist related to the current picture based on the current picturereference flag.

A video signal decoding method and apparatus according to the presentinvention includes: arranging temporal reference pictures used for interprediction of a current picture and generating a reference picture listby arranging the current picture after the arranged temporal referencepictures based on the current picture reference flag.

In the method and apparatus for decoding a video signal according to thepresent invention, the temporal reference picture includes at least oneof a short-term reference picture and a long-term reference picture, andthe temporal reference picture is arranged based on a priority orderbetween a short-term reference picture and a long-term referencepicture.

In the method and apparatus for decoding a video signal according to thepresent invention, the step of restoring the current block may furtherinclude determining whether or not the current picture reference mode isused in the current block, based on at least one of a reference pictureindex of the current block, a slice type, or a partition mode.

A method and apparatus for encoding a video signal according to thepresent invention includes: generating a reference picture list based ona current picture reference flag for a current picture; obtaining motioninformation about the current block in the current picture; andrestoring the current block using the motion information of the currentblock and the reference picture list for the current picture.

In the method and apparatus for encoding a video signal according to thepresent invention, the current picture reference flag indicates whetherat least one block belonging to a video sequence or a picture uses thecurrent picture reference mode.

In the method and apparatus for encoding a video signal according to thepresent invention, the current picture reference mode refers to a methodof predicting or restoring the current block by referring to apre-reconstructed block in the current picture.

In the method and apparatus for encoding a video signal according to thepresent invention, the current picture is added to the reference picturelist related to the current picture based on the current picturereference flag.

A video signal encoding method and apparatus according to the presentinvention includes: arranging temporal reference pictures used forinter-prediction of a current picture and generating a reference picturelist by arranging the current picture after the arranged temporalreference pictures based on the current picture reference flag.

In the method and apparatus for encoding a video signal according to thepresent invention, the temporal reference picture may include at leastone of a short-term reference picture and a long-term reference picture,and the temporal reference picture is arranged based on a priority orderbetween a short-term reference picture and a long-term referencepicture.

In the method and apparatus for encoding a video signal according to thepresent invention, the step of restoring the current block may furtherinclude determining whether or not the current picture reference mode isused in the current block, based on at least one of a reference pictureindex of the current block, a slice type, or a partition mode.

Advantageous Effects

According to the present invention, it is possible to improve theefficiency of predicting or restoring the current block based on thecurrent picture reference mode.

According to the present invention, the block vector used in the currentpicture reference mode may be efficiently derived.

According to the present invention, a reference picture list for thecurrent picture reference mode may be effectively generated.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to an embodiment of the present invention.

FIG. 2 is a block diagram illustrating a video decoding apparatusaccording an exemplary embodiment of the present invention.

FIG. 3 illustrates a current picture reference mode according to anembodiment of the present invention.

FIG. 4 illustrates a method of restoring the current block based on acurrent picture reference mode according to an embodiment of the presentinvention.

FIG. 5 illustrates a method of specifying a short-term reference picturestored in a decoding picture buffer according to an embodiment of thepresent invention.

FIG. 6 illustrates a method of specifying a long-term reference pictureaccording to an embodiment of the present invention.

FIG. 7 illustrates a method of constructing a reference picture listusing a short-term reference picture and a long-term reference pictureaccording to an embodiment of the present invention.

FIGS. 8 to 10 illustrate a method of constructing a reference picturelist for a current picture reference mode according to an embodiment towhich the present invention is applied.

BEST MODE FOR CARRYING OUT THE INVENTION

A video signal decoding method and apparatus according to the presentinvention includes: generating a reference picture list based on acurrent picture reference flag for a current picture; obtaining motioninformation about the current block in the current picture; andrestoring the current block using the motion information of the currentblock and the reference picture list.

In the method and apparatus for decoding a video signal according to thepresent invention, the current picture reference flag indicates whetherat least one block belonging to a video sequence or a picture uses acurrent picture reference mode.

In the method and apparatus for decoding a video signal according to thepresent invention, the current picture reference mode refers to a methodof predicting or restoring the current block by referring to apre-reconstructed block in the current picture.

In the method and apparatus for decoding a video signal according to thepresent invention, the current picture is added to the reference picturelist related to the current picture based on the current picturereference flag.

A video signal decoding method and apparatus according to the presentinvention includes: arranging temporal reference pictures used for interprediction of a current picture and generating a reference picture listby arranging the current picture after the arranged temporal referencepictures based on the current picture reference flag.

In the method and apparatus for decoding a video signal according to thepresent invention, the temporal reference picture includes at least oneof a short-term reference picture and a long-term reference picture, andthe temporal reference picture is arranged based on a priority orderbetween a short-term reference picture and a long-term referencepicture.

In the method and apparatus for decoding a video signal according to thepresent invention, the step of restoring the current block may furtherinclude determining whether or not the current picture reference mode isused in the current block, based on at least one of a reference pictureindex of the current block, a slice type, or a partition mode.

A method and apparatus for encoding a video signal according to thepresent invention includes: generating a reference picture list based ona current picture reference flag for a current picture; obtaining motioninformation about the current block in the current picture; andrestoring the current block using the motion information of the currentblock and the reference picture list for the current picture.

In the method and apparatus for encoding a video signal according to thepresent invention, the current picture reference flag indicates whetherat least one block belonging to a video sequence or a picture uses thecurrent picture reference mode.

In the method and apparatus for encoding a video signal according to thepresent invention, the current picture reference mode refers to a methodof predicting or restoring the current block by referring to apre-reconstructed block in the current picture.

In the method and apparatus for encoding a video signal according to thepresent invention, the current picture is added to the reference picturelist related to the current picture based on the current picturereference flag.

A video signal encoding method and apparatus according to the presentinvention includes: arranging temporal reference pictures used forinter-prediction of a current picture and generating a reference picturelist by arranging the current picture after the arranged temporalreference pictures based on the current picture reference flag.

In the method and apparatus for encoding a video signal according to thepresent invention, the temporal reference picture may include at leastone of a short-term reference picture and a long-term reference picture,and the temporal reference picture is arranged based on a priority orderbetween a short-term reference picture and a long-term referencepicture.

In the method and apparatus for encoding a video signal according to thepresent invention, the step of restoring the current block may furtherinclude determining whether or not the current picture reference mode isused in the current block, based on at least one of a reference pictureindex of the current block, a slice type, or a partition mode.

MODE FOR CARRYING OUT THE INVENTION

The present invention may be changed and modified variously and beillustrated with reference to different exemplary embodiments, some ofwhich will be described and shown in the drawings. However, theseembodiments are not intended for limiting the invention but areconstrued as including includes all modifications, equivalents andreplacements which belong to the spirit and technical scope of theinvention. Like reference numerals in the drawings refer to likeelements throughout.

Although the terms first, second, etc. may be used to describe variouselements, these elements should not be limited by these terms. Theseterms are used only to distinguish one element from another element. Forexample, a first element could be termed a second element and a secondelement could be termed a first element likewise without departing fromthe teachings of the present invention. The term “and/or” includes anyand all combinations of a plurality of associated listed items.

It will be understood that when an element is referred to as being“connected to” or “coupled to” another element, the element can bedirectly connected or coupled to another element or interveningelements. On the contrary, when an element is referred to as being“directly connected to” or “directly coupled to” another element, thereare no intervening elements present.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a,” “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “include” and/or“have,” when used in this specification, specify the presence of statedfeatures, integers, steps, operations, elements, and/or components, butdo not preclude the presence or addition of one or more other features,integers, steps, operations, elements, components, and/or groupsthereof.

Hereinafter, exemplary embodiments of the invention will be described indetail with reference to the accompanying drawings. Like referencenumerals in the drawings refer to like elements throughout, andredundant descriptions of like elements will be omitted herein.

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to an embodiment of the present invention.

Referring to FIG. 1, the video encoding apparatus 100 includes a picturedividing unit 110, prediction units 120 and 125, a transform unit 130, aquantization unit 135, a reordering unit 160, an entropy encoding unit165, an inverse quantization unit 140, an inverse transform unit 145, afilter unit 150, and a memory 155.

Each of the elements shown in FIG. 1 is shown independently to representdifferent characteristic functions in the video encoding apparatus, anddoes not mean that each element is composed of separate hardware or onesoftware configuration unit. That is, the elements are independentlyarranged for convenience of description, wherein at least two elementsmay be combined into a single element, or a single element may bedivided into a plurality of elements to perform functions. It is to benoted that embodiments in which some elements are integrated into onecombined element and/or an element is divided into multiple separateelements are included in the scope of the present invention withoutdeparting from the essence of the present invention.

Some elements are not essential to the substantial functions in theinvention and may be optional constituents for merely improvingperformance. The invention may be embodied by including onlyconstituents essential to embodiment of the invention, except forconstituents used to merely improve performance. The structure includingonly the essential constituents except for the optical constituents usedto merely improve performance belongs to the scope of the invention.

The picture dividing unit 110 may divide an input picture into at leastone processing unit. Here, the processing unit may be a prediction unit(PU), a transform unit (TU) or a coding unit (CU). The picture dividingunit 110 may divide one picture into a plurality of combinations of CUs,PUs and TUs and encode the picture by selecting one combination of CUs,PUs and TUs on the basis of a predetermined criterion (for example, acost function).

For example, one picture may be partitioned into a plurality of CUs. Arecursive tree structure, such as a quad tree structure, may be used topartition a picture into CUs. A CU, for which a picture or a CU of amaximum size may be as root, may be partitioned into sub-coding unitswith as many child nodes as the partitioned CUs. A CU which is notpartitioned any more in accordance with a predetermined limitation is aleaf node. That is, assuming that a CU may be partitioned into quadrantsonly, a single CU may be partitioned into at most four different CUs.

In the embodiments of the invention, a CU may be used to refer to notonly a unit of encoding but also a unit of decoding.

A PU may be partitioned into at least one square or rectangular formwith the same size in a CU. For PUs partitioned from a same CU, a PU mayhave different shape and/or size from another PU.

When a PU for intra prediction is generated based on a CU and the CU isnot a minimum CU, the CU may be subjected to intra prediction withoutbeing partitioned into plural PUs (N×N).

The prediction units 120 and 125 may include an inter prediction unit120 to perform inter prediction and an intra prediction unit 125 toperform intra prediction. The prediction units 120 and 125 may determinewhich of inter prediction and intra prediction is performed on a PU, andmay determine specific information (for example, an intra predictionmode, a motion vector, and a reference picture) of the determinedprediction method. Here, a processing unit on which prediction isperformed may be different from a processing unit for which a predictionmethod and specific information thereon are determined. For example, aprediction method and a prediction mode may be determined for each PU,while prediction may be performed for each TU. A residual value(residual block) between a generated predicted block and an originalblock may be input to the transform unit 130. Further, prediction modeinformation, motion vector information and the like used for predictionmay be encoded along with the residual value by the entropy encodingunit 165 and be transmitted to the decoding apparatus. When a specificencoding mode is used, the original block may be encoded and transmittedto the decoding apparatus without generating a prediction block by theprediction units 120 and 125.

The inter prediction unit 120 may predict a PU based on information onat least one picture among a previous picture of a current picture and asubsequent picture of a current picture. In some cases, the interprediction unit 120 may predict a PU based on information of a partiallyencoded region in the current picture. The inter prediction unit 120 mayinclude a reference picture interpolation unit, a motion predictionunit, and a motion compensation unit.

The reference picture interpolation unit may be supplied with referencepicture information from the memory 155 and generate pixel informationless than or equal to an integer pixel on a reference picture. In thecase of luma pixels, a DCT-based 8-tap interpolation filter with avariable filter coefficient may be used to generate pixel informationless than or equal to an integer pixel in a unit of a ¼ pixel. In thecase of chroma pixels, a DCT-based 4-tap interpolation filter with avariable filter coefficient may be used to generate pixel informationless than or equal to an integer pixel in a unit of a ⅛ pixel.

The motion prediction unit may perform motion prediction on the basis ofthe reference picture interpolated by the reference pictureinterpolation unit. Various methods, such as a full search-based blockmatching algorithm (FBMA), a three-step search (TSS) algorithm and a newthree-step search (NTS) algorithm, may be used to calculate a motionvector. A motion vector has a motion vector value in the unit of a ½ or¼ pixel on the basis of an interpolated pixel. The motion predictionunit may predict a current PU using different motion prediction methods.Various methods, such as skip mode, merge mode, and advanced motionvector prediction (AMVP) mode, intra block copy mode, etc. may be usedas the motion prediction method.

The intra prediction unit 125 may generate a PU on the basis ofinformation on a reference pixel neighboring to a current block. When areference pixel is a pixel for which inter prediction has been performedbecause a block neighboring to the current PU is a block for which interprediction has been performed, information on a reference pixel in theblock for which inter prediction has been performed may be replaced withinformation on a reference pixel in a block for which intra predictionhas been performed. That is, when a reference pixel is not available,information on the unavailable reference pixel may be replaced withinformation on at least one reference pixel of the available referencepixels.

A prediction mode of intra prediction includes a directional predictionmode in which reference pixel information is used according to aprediction direction and a non-directional prediction mode in whichinformation on direction is not used in performing prediction. A modefor predicting luma information and a mode for predicting chromainformation may be different from each other. Further, intra predictionmode information used to obtain luma information or predicted lumasignal information may be used to predict chroma information.

When a PU and a TU have the same size, intra prediction on the PU may beperformed based on a left pixel, an upper-left pixel and an upper pixelof the PU. On the other hand, when a PU and a TU have different sizes,intra prediction may be performed by using reference pixels which aredetermined based on the TU. Intra prediction using N×N partitioning maybe performed only for a minimum CU.

In the intra prediction method, a predicted block may be generated byapplying an adaptive intra smoothing (AIS) filter to the referencepixels according to the prediction mode. Different types of AIS filtersmay be applied to the reference pixels. In the intra prediction method,the intra prediction mode of a current PU may be predicted from an intraprediction mode of a PU neighboring to the current PU. In predicting theprediction mode of the current PU using mode information predicted froma neighboring PU, when the current PU and the neighboring PU have thesame intra prediction mode, information indicating that the current PUand the neighboring PU have the same prediction mode may be transmittedusing predetermined flag information. When the current PU and theneighboring PU have different prediction modes, information on theprediction mode of the current block may be encoded by entropy encoding.

A residual block including residual information may be generated. Theresidual information is a difference between the original block of thePU and the predicted block of a PU generated by the prediction units 120and 125. The generated residual block may be input to the transform unit130.

The transform unit 130 may transform the residual block using atransform method such as Discrete Cosine Transform (DCT), Discrete SineTransform (DST) or KLT. The residual block includes information on theresidual between the PU generated by the prediction units 120 and 125and the original block. A transform method to be used to transform theresidual block may be determined among DCT, DST and KLT on the basis ofthe information on the intra prediction mode of the PU which is used togenerate the residual block.

The quantization unit 135 may quantize values transformed into afrequency domain by the transform unit 130. A quantization coefficientmay be changed depending on a block or importance of an image. Valuesoutput from the quantization unit 135 may be provided to thedequantization unit 140 and the rearrangement unit 160.

The rearrangement unit 160 may rearrange quantized coefficients.

The rearrangement unit 160 may change a two-dimensional (2D) block ofcoefficients into a one-dimensional (1D) vector of coefficients throughcoefficient scanning. For example, the rearrangement unit 125 may changea 2D block of coefficients into a 1D vector of coefficients by scanningfrom DC coefficients to coefficients of a high frequency domain usingzigzag scanning. Vertical scanning for scanning a 2D block ofcoefficients in a vertical and horizontal scanning for scanning a 2Dblock of coefficients in a horizontal direction may be used depending ona size of a TU and an intra prediction mode, instead of zigzag scanning.That is, a scanning method may be selected based on the size of the TUand the intra prediction mode, among zigzag scanning, vertical scanning,and horizontal scanning.

The entropy encoding unit 165 may perform entropy encoding on the basisof the values obtained by the rearrangement unit 160. Various encodingmethods, such as exponential Golomb coding, context-adaptive variablelength coding (CAVLC), or context-adaptive binary arithmetic coding(CABAC), may be used for entropy encoding.

The entropy encoding unit 165 may encode a variety of information, suchas residual coefficient information and block type information on a CU,prediction mode information, partitioning unit information, PUinformation, transfer unit information, motion vector information,reference frame information, block interpolation information andfiltering information from the rearrangement unit 160 and the predictionunits 120 and 125.

The entropy encoding unit 165 may entropy-encode coefficients of a CUinput from the rearrangement unit 160.

The dequantization unit 140 and the inverse transform unit 145dequantize the values which are quantized by the quantization unit 135and inverse-transform the values which are transformed by the transformunit 130. A reconstructed block may be generated by adding the residualvalues to the predicted PU. The residual values may be generated by thedequantization unit 140 and the inverse transform unit 145. Thepredicted PU may be predicted by the motion vector prediction unit, themotion compensation unit, and the intra prediction unit of theprediction units 120 and 125.

The filter unit 150 may include at least one of a deblocking filter, anoffset unit, and an adaptive loop filter (ALF).

The deblocking filter may remove block distortion generated byboundaries between blocks in a reconstructed picture. Whether to applythe deblocking filter to a current block may be determined on the basisof pixels included in several rows or columns of the block. When thedeblocking filter is applied to a block, a strong filter or a weakfilter may be applied depending on a required deblocking filteringstrength. When horizontal filtering and vertical filtering are performedin applying the deblocking filter, the horizontal filtering and verticalfiltering may be performed in parallel.

The offset unit may apply the offset with respect to the original imageto the deblocking filtered image, in units of pixels. A region to whichthe offset may be applied may be determined after partitioning pixels ofa picture into a predetermined number of regions. The offset may beapplied to the determined region in consideration of edge information oneach pixel or the method of applying the offset to the determinedregion.

The ALF may perform filtering based on a comparison result of thefiltered reconstructed image and the original image. Pixels included inan image may be partitioned into predetermined groups, a filter to beapplied to each group may be determined, and differential filtering maybe performed for each group. Information on whether to apply the ALF maybe transferred by each coding unit (CU) and a shape and filtercoefficients of an ALF to be applied to each block may vary. Further, anALF with the same form (fixed form) may be applied to a block regardlessof characteristics of the block.

The memory 155 may store a reconstructed block or picture output fromthe filter unit 150, and the stored reconstructed block or picture maybe supplied to the prediction units 120 and 125 when performing interprediction.

FIG. 2 is a block diagram illustrating a video decoding apparatusaccording an exemplary embodiment of the present invention.

Referring to FIG. 2, the video decoding apparatus 200 may include anentropy decoding unit 210, a rearrangement unit 215, a dequantizationunit 220, an inverse transform unit 225, prediction units 230 and 235, afilter unit 240, and a memory 245.

When a video bitstream is input from the video encoding apparatus, theinput bitstream may be decoded according to an inverse process of thevideo encoding process performed in the video encoding apparatus.

The entropy decoding unit 210 may perform entropy decoding according toan inverse process of the entropy encoding process by the entropyencoding unit of the video encoding apparatus. For example, variousmethods, such as exponential Golomb coding, CAVLC or CABAC, may be usedfor entropy encoding, corresponding to the method used by the videoencoding apparatus.

The entropy decoding unit 210 may decode information associated withintra prediction and inter prediction performed by the encodingapparatus.

The rearrangement unit 215 may perform rearrangement on the bitstreamentropy-decoded by the entropy decoding unit 210 on the basis of therearrangement method of the encoding unit. The rearrangement unit 215may reconstruct and rearrange coefficients of a 1D vector form intocoefficients of a 2D block. The rearrangement unit 215 may be providedwith information on coefficient scanning performed by the encodingapparatus and may perform rearrangement using a method of inverselyscanning the coefficients, on the basis of scanning order performed bythe encoding apparatus.

The dequantization unit 220 may perform dequantization on the basis of aquantization parameter provided from the encoding apparatus and therearranged coefficients of the block.

The inverse transform unit 225 may perform inverse transform performedby the transform unit (that is, inverse DCT, inverse DST or inverse KLT)on a result of quantization performed by the video encoding apparatus.Inverse transform may be performed on the basis of a transfer unitdetermined by the video encoding apparatus. The transform unit 225 ofthe video decoding apparatus may selectively perform the transformscheme (e.g., DCT, DST, KLT) depending on a plurality of informationelements, such as a prediction method, a size of the current block and aprediction direction, etc.

The prediction units 230 and 235 may generate a prediction block on thebasis of information for generating prediction block and information ona previously-decoded block or picture provided. The information forgenerating prediction block may be provided from the entropy decodingunit 210. The information on a previously-decoded block or picture maybe provided from the memory 245

Similarly to the operation of the video encoding apparatus as describedabove, when a PU and a TU have the same size, intra prediction on the PUis performed based on left pixels, an upper-left pixel and upper pixelsof the PU. On the other hand, when a PU and a TU have different sizes,intra prediction may be performed using reference pixels which aredetermined based on the TU. Intra prediction using N×N partitioning maybe used only for a minimum CU.

The prediction units 230 and 235 may include a PU determination unit, aninter prediction unit and an intra prediction unit. The PU determinationunit may receive a variety of information, such as PU information,prediction mode information on an intra prediction method and motionprediction-related information on an inter prediction method, etc. fromthe entropy decoding unit 210, may determine a PU for a current CU. ThePU determination unit may determine which of the inter prediction andthe intra prediction is performed on the PU. An inter prediction unit230 may perform inter prediction on a current PU on the basis ofinformation on at least one picture among a previous picture and asubsequent picture of a current picture including the current PU. Aninter prediction unit 230 may use information necessary for interprediction for the current PU provided from the video encodingapparatus. The inter prediction may be performed on the basis of theinformation of the pre-reconstructed partial region in the currentpicture including the current PU.

In order to perform inter prediction, it may be determined, in an unitof a CU, whether a motion prediction method for a PU included in the CUis a skip mode, a merge mode, an AMVP mode or intra block copy mode.

An intra prediction unit 235 may generate a prediction block on thebasis of pixel information in a current picture. When a PU is a PU forwhich intra prediction is performed, intra prediction may be performedbased on intra prediction mode information on the PU provided from thevideo encoding apparatus. The intra prediction unit 235 may include anAIS (Adaptive Intra Smoothing) filter, a reference pixel interpolationunit, and a DC filter. The AIS filter performs filtering on referencepixels of a current block. The MS filter may decide whether to apply thefilter or not, depending on a prediction mode for the current PU. AISfiltering may be performed on the reference pixels of the current blockusing the prediction mode for the PU and information on the AIS filterprovided from the video encoding apparatus. When the prediction mode forthe current block is a mode not performing AIS filtering, the AIS filtermay not be applied.

When the prediction mode for the PU indicates a prediction mode ofperforming intra prediction on the basis of pixel values obtained byinterpolating the reference pixels, the reference pixel interpolationunit may generate reference pixels in a unit of a fractional pixel lessthan an integer pixel (i.e. full pixel) by interpolating the referencepixels. When the prediction mode for the current PU indicates aprediction mode of generating a prediction block without interpolatingthe reference pixels, the reference pixels may not be interpolated. TheDC filter may generate a prediction block through filtering when theprediction mode for the current block is the DC mode.

The reconstructed block or picture may be provided to the filter unit240. The filter unit 240 includes a deblocking filter, an offset unit,and an ALF.

The video encoding apparatus may provide information on whether thedeblocking filter is applied to a corresponding block or picture, andinformation on which of a strong filter and a weak filter is appliedwhen the deblocking filter is used. The deblocking filter of the videodecoding apparatus may be provided with information on the deblockingfilter from the video encoding apparatus and may perform deblockingfiltering on a corresponding block.

The offset unit may apply offset to the reconstructed picture on thebasis of information on an offset type and offset value applied to thepicture in the encoding process.

The ALF may be applied to a CU on the basis of information on whetherthe ALF is applied and ALF coefficient information, etc. provided fromthe encoding apparatus. The ALF information may be included and providedin a specific parameter set.

The memory 245 may store the reconstructed picture or block for use as areference picture or a reference block and may provide the reconstructedpicture to an output unit.

As described above, in the embodiments of the invention, the term“coding unit” is used as an encoding unit for a convenience ofdescriptions. However, the term “coding unit” may be also used as a unitof decoding.

FIG. 3 illustrates a current picture reference mode according to anembodiment of the present invention.

The block to be decoded (hereinafter, referred to as a current block)may be predicted or restored by referring to a block reconstructedbefore the current block (hereinafter referred to as a reference block),and the current block and the reference block may belong to the samepicture. A method of predicting or restoring a current block withreference to a pre-reconstructed block in the same picture will bereferred to as a current picture reference mode.

The current picture reference mode is similar to the intra mode in thatthe current picture reference mode uses the pre-reconstructed samplevalue in the same picture, but is different from the intra mode in thatthe current picture reference mode uses a vector representing theposition difference between the current block and the reference block.In addition, the current picture reference mode is similar to the intermode in that a block vector is used to specify a reference block, but isdifferent from the inter mode in that the current picture reference modeuses a reference block belonging to the same picture as the currentblock while the inter mode uses a reference block belonging to adifferent picture from the current block. In case that the imagecontains a large number of characters such as Hangul or alphabets, ifthe previous block includes the character to be encoded in the currentblock, the encoding performance can be improved by using the currentpicture reference mode.

The video decoding apparatus may determine whether the current block isa block coded in the current picture reference mode. For suchdetermination, mode information (e.g., index, flag) indicating that thecurrent block is a block coded in the current picture reference mode maybe signaled. Alternatively, whether the current block is a block codedin the current picture reference mode may be determined by checking thereference picture index of the current block.

For example, if the reference picture index of the current blockspecifies a picture including the current block, the current block maybe predicted/restored based on the current picture reference mode.Otherwise, the current block may be predicted/restored based on a Skipmode, Merge mode or an AMVP (Advanced Motion Vector Prediction) mode.

Referring to FIG. 3, in the current picture reference mode, aneighboring block to the current block (for example, left, top, left-topneighboring block) may be used as a reference block of the current blockand a block located at a certain distance in the left, top, or left-topdirection may be also used as a reference block of the current block. Inorder to specify the position of the reference block with reference tothe position of the block to be decoded, a vector composed of at leastone of the x component and the y component may be used. Hereinafter, thevector will be referred to as a block vector. The block vector mayrepresent the position difference between the current block and thereference block used in the current picture reference mode.

In encoding the block vector, a predicted block vector may be generatedthrough predictive coding and a differential block vector between anoriginal block vector and a prediction block vector may be only encoded.Here, the prediction block vector may be derived from a block vector (ora motion vector) of a neighboring block adjacent to the current block.For example, block vector candidates including a block vector (or motionvector) of at least one neighboring block may be constructed, and one ofthe block vector candidates may be selectively used based on an indexfor specifying a block vector of the current block. On the other hand,the prediction block vector is not limited to being derived from aneighboring block adjacent to the current block, and may be derived froma block vector in a maximum coding unit (largest coding unit) includingthe current block, and may be derived from a block vector in the maximumcoding unit row (largest coding unit row) including the current block.

Alternatively, the block vector may be encoded without theabove-described predictive coding process. For example, the videoencoding apparatus may search for a block most similar to the currentblock in the same picture, determine the block as a reference block, andcalculate a block vector corresponding to a position difference betweenthe current block and the reference block. Then, the video encodingapparatus may divide the calculated block vector into an absolute valuecomponent and a sign component, and transmit them to the video decodingapparatus. The video decoding apparatus may recover the block vector bydecoding the coded absolute value component and the sign component.

FIG. 4 illustrates a method of restoring the current block based on acurrent picture reference mode according to an embodiment of the presentinvention.

Referring to FIG. 4, a reference picture list related to the currentpicture may be generated based on the current picture reference flag(S400).

The current picture reference flag may indicate whether at least oneblock (e.g., a coding block, a prediction block) belonging to a videosequence or picture uses the current picture reference mode. The currentpicture reference flag may be signaled on a video sequence and/orpicture basis. For example, when the value of the current picturereference flag is 1, it indicates that at least one block belonging tothe current video sequence and/or the current picture uses the currentpicture reference mode.

The reference picture list related to the current picture may include apicture having a different temporal order from the current picture andrestored before the current picture (hereinafter referred to as atemporal reference picture). A method of generating a reference picturelist including temporal reference pictures will be described withreference to FIG. 5 to FIG. 7. Here, the temporal reference picture mayrefer to a picture to which an in-loop filter is applied. The in-loopfilter may refer to at least one of the deblocking filter, the sampleadaptive offset filter, and the adaptive loop filter described above.

When the current picture uses the current picture reference mode (thatis, the value of the current picture reference flag is equal to 1), thecurrent picture may be added to the reference picture list related tothe current picture. The current picture may be added to the referencepicture list, based on a predetermined priority. An indication “used forshort-term reference” or “used for long-term reference” may be marked inthe current picture, depending on the position to which the currentpicture is added in the reference picture list. For example, if thecurrent picture is located between short-term reference pictures, anindication “used for short-term reference” may be marked. Alternatively,if the current picture is located after the long-term reference picture,an indication representing that the current picture is used as thelong-term reference picture may be marked in the current picture. Inthis case, the current picture may be a picture to which an in-loopfilter is not applied, unlike the other pictures included in thereference picture list. Alternatively, it may be added to the referencepicture list after the in-loop filter is selectively applied to thepre-reconstructed partial area in the current picture. A method ofgenerating a reference picture list including the current picture as areference picture will be described with reference to FIGS. 8 to 10.

When the blocks belonging to the current picture are encoded in theintra mode and the current picture reference mode, the video encodingapparatus of the present invention encodes the slice type of the currentpicture into a P slice or a B slice and does not encode it into an Islice. Thus, if the current picture uses the current picture referencemode, the slice type of the current picture may be either a P slice or aB slice. If the slice type of the current picture is an I-slice, thevideo decoding apparatus does not allow the current picture to use thecurrent picture reference mode.

Referring to FIG. 4, motion information on the current block in thecurrent picture may be obtained (S410).

The motion information of the present invention may include at least oneof a motion vector, a block vector, and a reference picture index. Here,the motion vector indicates the position difference between the currentblock in the current picture and the reference block in the picture of adifferent time from the current picture, and the block vector indicatesthe position difference between the current block in the current pictureand the reference block in the current picture. However, in the presentinvention, the term “block vector” is merely used to distinguish thesedifferences, and the block vector may be understood as a conceptcorresponding to the motion vector.

The motion vector and/or the reference picture index of the currentblock may be obtained based on a skip mode, a merge mode, or an advancedmotion vector prediction (AMVP) mode.

Meanwhile, the block vector of the current block may be obtained byusing a predicted block vector and a differential block vector. Here,the prediction block vector may be derived using a motion vector (or ablock vector) of a neighboring block spatially/temporally adjacent tothe current block. The neighboring blocks of the current block may belimited to only those blocks belonging to a predetermined range withinthe areas reconstructed before the current block. For example, there maybe the restriction that the neighboring block belongs to the largestcoding unit including the current block. There may be the restrictionthat the neighboring block belongs to the largest coding unit rowincluding the current block. Also, if there are a plurality ofneighboring blocks, a block closest to the current block in the decodingorder may be used.

The block vector of the current block may be obtained using a skip mode,a merge mode, or an advanced motion vector prediction (AMVP) mode aswell as the above-described method.

Referring to FIG. 4, the current block may be predicted/restored usingthe reference picture list of the current picture and the motioninformation of the current block (S420).

Specifically, the reference picture of the current block may beselected, from the reference picture list, based on the referencepicture index of the current block. The motion vector (or block vector)of the current block may be used to specify the reference block in thereference picture. The reconstructed sample of the specified referenceblock may be used to predict/restore the current block.

If the reference picture selected based on the reference picture indexof the current block is the current picture, it may be known that thecurrent block uses the current picture reference mode. That is, thecurrent block determines a reference block at the pre-reconstructed areaof the current picture, based on the motion vector (or block vector)derived in step S410, and the reconstructed sample of the referenceblock may be set as the predicted sample or the restored sample.

When the current picture reference mode is used, the block belonging tothe current picture may perform selectively one of a bi-directionalprediction (PRED_BI) using a reference picture list 0 (list0) and areference picture list 1 (list1), a uni-directional prediction (PRED_L0)using a list0 or a uni-directional prediction PRED_L1 using list 1. Tothis end, the syntax inter_pred_idc indicating PRED_BI, PRED_L0, orPRED_L1 may be signaled on a block-by-block basis. Alternatively, whenthe current picture reference mode is used, the syntax inter_pred_idcvalue may be limited to indicate one of PRED_L0 or PRED_L1.Alternatively, it may be limited not to perform bi-directionalprediction (PRED_BI) only when the current block has a predeterminedshape and/or size. Herein, the predetermined shape may be a case wherethe partition mode of the current block is a square or a symmetricpartition. A predetermined size is one of the block sizes predefined inthe video decoding apparatus. A predetermined size may mean the blocksize for which bi-directional prediction based on the current picturereference mode is allowed. Here, at least one of 4×4, 8×8, 8×4, 4×8,16×16, etc. may be fixedly set in the video decoding apparatus.

If the current picture reference mode is used, the block belonging tothe current picture may performs 1) inter-prediction using the referenceblock in the current picture and 2) bi-directional prediction includinginter prediction using the reference block in the reference picturehaving a temporal order different from that of the current picture.Here, the block belonging to the current picture may be a block coded inthe current picture reference mode, or may be a block coded in theintra/inter mode. The reference block in the reference picture may be ablock coded in intra/inter mode. For example, bi-directional predictionmay be performed even when the reference block for List 0 is a blockcoded in the current picture reference mode and the reference block forList 1 is a block coded in the inter/intra mode. Alternatively,bi-directional prediction may be performed even when the reference blockfor List 0 is a block coded in inter/intra mode and the reference blockfor List 1 is a block coded in the current picture reference mode.

In this way, the current picture reference mode may be selectively usedfor the blocks belonging to the current picture, and it may bedetermined whether the current picture reference mode is used for eachblock. Here, the block may mean a coding block belonging to a range of amaximum coding block to a minimum coding block and having apredetermined size. Alternatively, the block may mean a prediction blockdetermined according to the partition mode of the coding block, or maybe a transform block that is a basic unit for performing the transform.

Whether or not the current picture reference mode is used may bedetermined based on at least one of a reference picture index of thecurrent block, a slice type, or a partition mode of the current block,and hereinafter, it will be described in detail.

1. Embodiment 1: Method Using Reference Picture Index

Whether or not the current block uses the current picture reference modemay be determined based on the reference picture index of the currentblock.

Specifically, the picture is selected, from the reference picture list,based on the reference picture index of the current block. When theselected picture is the current picture including the current block, itmay be determined that the current block uses the current picturereference mode.

Alternatively, if the value of the current picture reference flag forthe current picture is equal to 1, the current picture may be added tothe reference picture list. As will be described later with reference toFIG. 5, the current picture may be located last in the reference picturelist. Therefore, if the value of the reference picture index of thecurrent block is equal to a value obtained by subtracting 1 from thetotal number of reference pictures belonging to the reference picturelist or a maximum value among the indexes assigned to the referencepicture list, it may be determined that the current block uses thecurrent picture reference mode.

Alternatively, whether the current picture reference mode is used or notmay be determined by comparing output order information (picture ordercount) of the current picture with output order information (pictureorder count) of the reference picture selected by the reference pictureindex of the current block. For example, when the current block performsa uni-directional prediction (PRED_L0) using the reference picture list0 (list0), it may be inferred as shown in Equation 1, and when thecurrent block performs the uni-directional prediction (PRED_L1) usingthe reference picture list 1 (list1), it may be inferred as shown inEquation 2.

curr_pic_as_ref_pu=(DiffPicOrderCnt(RefPicList0[ref_idx_10],currPic)==0)?1:0  [Equation 1]

curr_pic_as_ref_pu=(DiffPicOrderCnt(RefPicList1[ref_idx_11],currPic)==0)?1:0  [Equation 2]

In Equations 1 and 2, if the variable curr_pic_as_ref_pu is equal to 1,it indicates that the current block uses the current picture referencemode. Otherwise, it indicates that the current block does not use thecurrent picture reference mode. DiffPicOrderCnt is a function thatoutputs “0” when the output order information between the referencepicture selected by the reference picture index (e.g., RefPicList0[ref_idx_10]) and the current picture currPic is the same, and outputs“1” when the output order information is different from each other. And,RefPicList0 and RefPicList1 represent the reference picture list 0 andthe reference picture list 1, respectively.

2. Embodiment 2: Method Using Slice Type

The current picture reference mode may be adaptively used according tothe slice type. For example, there may be restriction that the currentpicture reference mode is used only in P slice. In this case, whether ornot the current picture reference mode is used may be inferred as shownin the following equation 3.

curr_pic_as_ref_pu=(P_SLICE && DiffPicOrderCnt(RefPicList0[ref_idx_10],currPic)==0)?1:0  [Equation 3]

If the current picture is a P slice and the value of the current picturereference flag is equal to 1, the current picture may be added to thereference picture list 0 and may not be added to the reference picturelist 1.

3. Embodiment 3: Method Using Partition Mode

The current picture reference mode may be selectively used according tothe partition mode of the coding block. For example, if the partitionmode is a symmetric partition, the current picture reference mode may beset to be allowed. Therefore, the value of the partition mode of thecoding block in which the current picture reference mode is used may beset to be one of PART_2N×2N, PART_N×2N, PART_2N×N, and PART_N×N.Conversely, in the coding block in which the current picture referencemode is used, it does not have a partition mode of PART_2N×nU,PART_2N×nD, PART_nL×2N, and PART_nR×2N, which are asymmetric partitions.

FIG. 5 illustrates a method of specifying a short-term reference picturestored in a decoding picture buffer according to an embodiment of thepresent invention.

The temporal reference picture may be stored in the decoding picturebuffer (DPB) and used as a reference picture if necessary for interprediction of the current picture. The temporal reference picture storedin the decoding picture buffer may include a short-term referencepicture. The short-term reference picture means a picture in which thedifference of output order information (POC) from the current picture isnot large.

Information specifying the short-term reference picture to be stored inthe decoding picture buffer at the present time is composed of outputorder information (POC) of the reference picture and a flag indicatingwhether the current picture directly refer to (for example,used_by_curr_pic_s0_flag, used_by_curr_pic_s1_flag). And, it is referredto as a reference picture set. Specifically, when the value of theused_by_curr_pic_s0_flag [i] is equal to 0, if the i-th short-termreference picture in the short-term reference picture set has a valuesmaller than the output order (POC) of the current picture, it indicatesthat the i-th short-term reference picture is not used as a referencepicture of the current picture. when the value of theused_by_curr_pic_s1_flag [i] is equal to 0, if the i-th short-termreference picture in the short-term reference picture set has a valuelarger than the output order (POC) of the current picture, it indicatesthat the i-th short-term reference picture is not used as a referencepicture of the current picture.

Referring to FIG. 5, in the case of a picture having a POC value of 26,all three pictures (i.e., pictures having POC values of 25, 24, and 20)may be used as a short-term reference picture in inter prediction.However, since the value of used_by_curr_pic_s0 flag for the picturehaving the POC value of 25 is equal to 0, the picture having the POCvalue of 25 is not directly used for the inter prediction of the picturehaving the POC value of 26.

Thus, the short-term reference picture may be specified based on outputorder information (POC) of the reference picture and the flag indicatingwhether to use as the reference picture of the current picture.

On the other hand, for a picture not shown in the reference picture setfor the current picture, an indication (for example, unused forreference) that the picture is not used as a reference picture may bemarked and further removed from the decoding picture buffer.

FIG. 6 illustrates a method of specifying a long-term reference pictureaccording to an embodiment of the present invention.

In the case of the long-term reference picture, since the differencebetween the POC values of the current picture and the long-termreference picture is large, the least significant bit (LSB) and the mostsignificant bit (MSB) of the POC value may be used.

Therefore, the POC value of the long-term reference picture may bederived by using the LSB of the POC value of the reference picture, thePOC value of the current picture, and the difference between the MSB ofthe POC value of the current picture and the MSB of the POC value of thereference picture.

For example, it is assumed that the POC value of the current picture is331, the maximum value that may be represented by the LSB is 32, and thepicture having the POC value of 308 is used as the long-term referencepicture.

In this case, the POC value 331 of the current picture may be expressedas 32*10+11, where 10 is the MSB value and 11 is the LSB value. The POCvalue 308 of the long-term reference picture is represented by 32*9+20,where 9 is the MSB value and 20 is the LSB value. At this time, the POCvalue of the long-term reference picture may be derived as shown in theequation of FIG. 6.

FIG. 7 illustrates a method of constructing a reference picture listusing a short-term reference picture and a long-term reference pictureaccording to an embodiment of the present invention.

Referring to FIG. 7, a reference picture list including a temporalreference picture may be generated by considering whether a temporalreference picture is a short-term reference picture and a POC value of ashort-term reference picture. Here, the reference picture list mayinclude at least one of a reference picture list 0 for L0 prediction anda reference picture list 1 for L1 prediction.

Specifically, in the reference picture list 0, the reference picturesmay be arranged in an order of a short-term reference picture(RefPicSetCurr0) having a POC value smaller than the current picture, ashort-term reference picture (RefPicSetCurr1) having a POC value largerthan the current picture, and a long-term reference picture(RefPicSetLtCurr).

In the reference picture list 1, the reference pictures may be arrangedin an order of a short-term reference picture (RefPicSetCurr1) having aPOC value larger than the current picture, a short-term referencepicture (RefPicSetCurr0) having a POC value smaller than the currentpicture, and a long-term reference picture (RefPicSetLtCurr).

In addition, a plurality of temporal reference pictures included in thereference picture list may be rearranged to improve the codingefficiency of the reference picture index allocated to temporalreference pictures. This may be performed adaptively based on the listrearrangement flag (list_modification_present_flag). Here, the listrearrangement flag is information for specifying whether or notreference pictures in the reference picture list are rearranged. Thelist rearrangement flag may be signaled for each of the referencepicture list 0 and the reference picture list 1.

For example, when the value of the list rearrangement flag(list_modification_present_flag) is equal to 0, the reference picturesin the reference picture list are not rearranged, and only when thevalue of the list rearrangement flag (list_modification_present_flag) isequal to 1, the reference pictures may be rearranged.

If the value of the list rearrangement flag(list_modification_present_flag) is equal to 1, the reference picturesin the reference picture list may be rearranged using the list entryinformation list_entry [i]. Here, the list entry information (list_entry[i]) may specify the reference picture and/or the reference pictureindex to be located at the current position (i.e., the i-th entry) inthe reference picture list.

Specifically, the reference picture corresponding to the list entryinformation (list entry [i]) may be specified in the reference picturelist, and the specified reference picture may be arranged at the i-thentry in the reference picture list.

The list entry information may be obtained by the number of referencepictures contained in the reference picture list or by the maximumreference picture index of the reference picture list. Further, the listentry information may be obtained based on the slice type of the currentpicture. That is, if the slice type of the current picture is a P slice,the list entry information list_entry_10 [i] for the reference picturelist 0 is obtained. If the slice type of the current picture is a Bslice, the entry information (list_entry_11 [i]) for the referencepicture list 1 may be additionally obtained.

FIGS. 8 to 10 illustrate a method of constructing a reference picturelist for a current picture reference mode according to an embodiment towhich the present invention is applied.

Referring to FIG. 8, in the reference picture list 0, the referencepictures may be arranged in an order of a short-term reference picture(hereinafter referred to as a first short-term reference picture) havinga smaller POC value than the POC value of the current picture, ashort-term reference picture having a POC value larger than the POCvalue of the current picture (hereinafter referred to as a secondshort-term reference picture), and a long-term reference picture. In thereference picture list 1, the reference pictures may be arranged in anorder of a second short-term reference picture, a first short-termreference picture, and a long-term reference picture. Then, the currentpicture may be arranged after the long-term reference picture, in thereference picture list 0 and the reference picture list 1. An index isassigned to each of the reference pictures arranged in this manner, andan index of the largest value may be assigned to the current picture.Here, the index of the largest value may be derived based on informationabout the total number of reference pictures contained in the referencepicture list. The information about the total number may be encoded bythe video encoding apparatus and signaled to the video decodingapparatus. For example, the video encoding apparatus may encode a valueobtained by subtracting 1 from the total number of reference picturesincluded in the reference picture list. In this case, in the videodecoding apparatus, the reference picture index of the current picturemay be assigned equal to a value of information about the total number.

However, the present invention is not limited to this. As shown in FIGS.9 and 10, the coding performance of the reference picture list may beimproved by adding the current picture before the long-term referencepicture.

Referring to FIG. 9, the current picture may be arranged between theshort-term reference pictures in the reference picture list.Specifically, in the reference picture list 0, the reference picturesmay be arranged in an order of a first short-term reference picture, acurrent picture, a second short-term reference picture, and a long-termreference picture. In the reference picture list 1, the referencepictures may be arranged in an order of a second short-term referencepicture, a current picture, a first short-term reference picture, and along-term reference picture.

Alternatively, the current picture may be arranged between theshort-term reference picture and the long-term reference picture in thereference picture list. Referring to FIG. 10, in the reference picturelist 0, the reference pictures may be arranged in an order of a firstshort-term reference picture, a second short-term reference picture, acurrent picture, and a long-term reference picture. In the referencepicture list 1, the reference pictures may be arranged in an order of asecond short-term reference picture, a first short-term referencepicture, a current picture, and a long-term reference picture.

FIGS. 8 to 10 illustrate an embodiment of constructing a referencepicture list in which the number of each of a short-term referencepicture having a smaller POC value than the current picture, ashort-term reference picture having a larger POC value than the currentpicture, and a long-term reference picture is 1. FIGS. 8 to 10 merelyillustrate the arrangement order of the reference pictures, and aplurality of short-term reference pictures (i.e., a short-term referencepicture set) and long-term reference pictures (i.e., a long-termreference picture set) may be used.

INDUSTRIAL AVAILABILITY

The present invention can be used to code a video signal.

1-15. (canceled)
 16. A method of decoding a video signal, the methodcomprising: determining a type of prediction mode of a current block ina current picture, wherein the type of prediction mode includes one of afirst mode, a second mode and a third mode, wherein, the first moderefers to a method of predicting the current block by referring to areference pixels neighboring to the current block in the currentpicture, the second mode refers to a method of predicting the currentblock by referring to a pre-reconstructed block in a different picture,and the third mode refers to a method of predicting the current block byreferring to a reference block in the current picture, obtaining blockvector information of the current block in the current picture when thetype of prediction mode is the third mode, wherein the block vectorinformation of the current block specifies a position difference betweenthe current block and the reference block used in the third mode, andrestoring the current block using the block vector information of thecurrent block, wherein the block vector information of the current blockis derived from block vector candidates.
 17. The method of claim 16,wherein one of the block vector candidates is selected based on an indexspecifying selection of block vector information.
 18. The method ofclaim 16, wherein the reference block of the current block in the thirdmode is a neighboring block of the current block.
 19. The method ofclaim 16, wherein the reference block of the current block in the thirdmode is a block located at a certain distance in the left, top, orleft-top direction from the current block.
 20. A method of encoding avideo signal, the method comprising: determining a type of predictionmode of a current block in a current picture, wherein the type ofprediction mode includes one of a first mode, a second mode and a thirdmode, wherein, the first mode refers to a method of predicting thecurrent block by referring to a reference pixels neighboring to thecurrent block in the current picture, the second mode refers to a methodof predicting the current block by referring to a pre-reconstructedblock in a different picture, and the third mode refers to a method ofpredicting the current block by referring to a reference block in thecurrent picture, obtaining block vector information of the current blockin the current picture when the type of prediction mode is the thirdmode, wherein the block vector information of the current blockspecifies a position difference between the current block and thereference block used in the third mode, and encoding the block vectorinformation of the current block, wherein the block vector informationof the current block is encoded by using block vector candidates. 21.The method of claim 20, wherein one of the block vector candidates isselected based on an index specifying selection of block vectorinformation.
 22. The method of claim 20, wherein the reference block ofthe current block in the third mode is a neighboring block of thecurrent block.
 23. The method of claim 20, wherein the reference blockof the current block in the third mode is a block located at a certaindistance in the left, top, or left-top direction from the current block.24. A non-transitory computer-readable storage medium storing abitstream, the bitstream comprising: information related to whether todetermine a type of prediction mode of a current block in a currentpicture, wherein the type of prediction mode includes one of a firstmode, a second mode and a third mode, wherein, the first mode refers toa method of predicting the current block by referring to a referencepixels neighboring to the current block in the current picture, thesecond mode refers to a method of predicting the current block byreferring to a pre-reconstructed block in a different picture, and thethird mode refers to a method of predicting the current block byreferring to a reference block in the current picture, informationrelated to obtain block vector information of the current block in thecurrent picture when the type of prediction mode is the third mode,wherein the block vector information of the current block specifies aposition difference between the current block and the reference blockused in the third mode, and encoded the block vector information of thecurrent block, wherein the block vector information of the current blockis encoded by using block vector candidates.